﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Mengsk.ERP.Database;
using System.Data.SqlClient;
using System.Diagnostics;

namespace Mengsk.ERP.Delivery
{
    public class DeliveryManager
    {
        private static readonly DeliveryManager instance = new DeliveryManager();

        private const string TABLE_ARRIVEINDELIVERY = "ArrvieInDelivery";

        public static DeliveryManager Instance { get { return instance; } }

        public void Insert(ArrvieInDelivery delivery)
        {
            try
            {
                if (DBHelper.Instance.Insert("", TABLE_ARRIVEINDELIVERY, delivery, false) < 1)
                {
                    throw new Exception("无法插入记录到数据库");
                }
            }
            catch (SqlException sql)
            {
                Debug.WriteLine(sql.Message);
            }
        }

    }
}
